package com.bj58.mis.apm.server.logreceiver.repository;

import com.bj58.mis.apm.server.logreceiver.dto.ApmLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author: zhangfx
 * @create: 2018-06-06 17:47
 **/
public interface ApmLogRepository extends JpaRepository<ApmLog, Long> {

    @Query(value = "select * from apm_log order by id desc limit :start,:limit", nativeQuery = true)
    public List<ApmLog> queryByPage(@Param("start") int start, @Param("limit") int limit);

    @Query(value = "select count(1) from apm_log", nativeQuery = true)
    public int queryCount();
}
